package com.cda.service.impl;

import com.cda.dao.SfdevicebindDao;
import com.cda.entity.MonneyInfoLog;
import com.cda.entity.SfdevicebindEntity;
import com.cda.service.SfdevicebindService;
import net.sf.json.JSONObject;
import org.hibernate.annotations.Cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by peiming on 2019/3/6.
 */
@Service("sfdevicebindService")
@Transactional
public class SfdevicebindServiceImpl  implements SfdevicebindService {


    @Autowired
    SfdevicebindDao sfdevicebindDao;

    @Cacheable( value = "cache" )
    public SfdevicebindEntity findByClientIp(String clientIp) {

        System.out.println("【进入查询设备绑定表】"+clientIp);
        SfdevicebindEntity sb = sfdevicebindDao.findByClientIp(clientIp);
        //Iterable<SfdevicebindEntity>  sb = sfdevicebindDao.findAll();
        System.out.println( JSONObject.fromObject(sb).toString() );
        return  sb;

    }


}
